package org.btik.light.server.platform.common.api.dao;

import org.btik.light.cache.CurrentMemCachePo;
import org.btik.light.meta.DevMo;
import org.btik.light.meta.LightNode;
import org.btik.light.server.platform.common.api.bean.dev.access.DevAccount;

import java.util.Collection;
import java.util.List;

public interface LightDao {

    Collection<DevMo> listAtNode(String node);

    void addDev(LightNode lightNode, DevMo moMeta);

    LightNode addNode(LightNode lightNode);

    /**
     * 当前系统的node,可能被修改，每次从DAO取
     */
    LightNode getThisSystemNode();

    DevMo getMO(String sn);

    /**
     * 非易失数据，持久储存查询
     */
    <T extends CurrentMemCachePo<T>> T get(String key, Class<T> type);

    /**
     * 非易失数据，持久储存
     */
    <T extends CurrentMemCachePo<T>> T save(T po);

    <T extends CurrentMemCachePo<T>> Collection<T> list(Class<T> type);

    Collection<DevMo> listCameraAtNode(String node);

    <T extends CurrentMemCachePo<T>> void delete(String id, Class<T> type);

}
